package com.irdstudio.efp.nls.common.util;

import java.util.Objects;

import com.irdstudio.efp.nls.common.constant.MSAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.constant.MYDAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.constant.PrdInfoEnum;
import com.irdstudio.efp.nls.common.constant.ZXDAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.constant.ZZDAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.constant.sed.SEDAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.constant.wsd.WSDAdaptedSoltEnum;
import com.irdstudio.efp.nls.common.util.factory.SoltFactory;
import com.irdstudio.efp.nls.common.constant.yed.YEDAdaptedSoltEnum;

/**
* 普税贷产品对此部分代码做了变更
* 说明：开发对原有代码做了流程分支新增
* 评估是否会影响线上功能：否
* 评估时间：2020/5/25
* 处理方案：对重构代码进行回滚，普税贷单独新增处理逻辑
*/
/**
 * 队列过程中的工具类
 * 
 * @author huangwb
 * @since 2018年12月28日 上午11:09:44
 * @version 1.0
 */
public class PrdQueueSlotUtils {

	/**
	 * 校验产品插槽信息
	 * 
	 * @param prdId
	 * @param soltCode
	 * @param soltName
	 * @param soltService
	 * @param soltOrder
	 * @author huangwb
	 * @since 2018年12月28日 下午2:10:22
	 * @version 1.0
	 */
	public static boolean checkAdaptedSoltInfo(String prdId, String soltCode, String soltName, String soltService, String soltStage, int soltOrder) {
		if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.MASHANG.getPrdId())) {
			return MSAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage, soltOrder);
		} else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.ZZD.getPrdId())) {
			return ZZDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage, soltOrder);
		} else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.MYD.getPrdId())) {
			return MYDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage, soltOrder);
		} else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.ZXD.getPrdId())) {
			return ZXDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage, soltOrder);
		}else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.SHUIEDAI.getPrdId())){
			return SEDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage,  soltOrder);
		}else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.WSD.getPrdId())){
			return WSDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage,  soltOrder);
		}else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.PSD.getPrdId())){
			return SoltFactory.createSolt(prdId).check(prdId,soltCode,soltName,soltService,soltStage,soltOrder);
		}else if (Objects.nonNull(prdId) && prdId.equals(PrdInfoEnum.YED.getPrdId())){
			return YEDAdaptedSoltEnum.parse(prdId, soltCode).validateSoltService(soltName, soltService, soltStage,  soltOrder);
		}
		return false;

	}

}
